﻿
Imports WumpusWorld_2._0.Domain

Namespace Domain



    Public Class Cells

#Region " Variables "

        Private _cellArray(,) As Cell
        Private _activeCell As Cell


#End Region

#Region " Properties "

        Public Property cellArray As Cell(,)
            Get
                Return _cellArray
            End Get
            Set(ByVal value As Cell(,))
                _cellArray = value
            End Set
        End Property

        Public Property activeCell As Cell
            Get
                Return _activeCell
            End Get
            Set(ByVal value As Cell)
                _activeCell = value
            End Set
        End Property

#End Region

#Region " Methods "

        ''' <summary>
        ''' Returns the cell where the agent is 
        ''' </summary>
        ''' <param name="array"></param>
        ''' <returns></returns>
        ''' <remarks></remarks>
        Public Function getActiveCell(ByVal array(,) As Cell)
            For Each celle In array
                If celle.hasAgent Then
                    Return celle
                    Exit Function

                End If

            Next

            Return Nothing

        End Function

#End Region

    End Class
End Namespace